<div id="sidebar">
    <div class="sidebar">
        {% for item in base.widget %}
        {% if item.html|uw == "topic" %}
            {% if base.hot_topic|not_empty %}
            <div class="widget">
                <h3>{{item.title|uw}}</h3>
                <ul class="topic">
                    {% for t in base.hot_topic %}
                    <li><a href="/topic/get?id={{t.id|uw}}">{{t.title|uw}}</a> <i class="iconfont">&#xe654;</i> {{t.num|uw}}</li>
                    {% endfor %}
                </ul>
            </div> 
            {% endif %}
        {% else if item.html|uw == "tag" && base.tag|not_empty %}
            {% if base.tag|not_empty %}
            <div class="widget key">
                <h3>{{item.title|uw}}</h3>
                <ul class="tags">
                    {% for tag in base.tag%}
                    <li><a href="/index?t={{tag}}">{{tag}}</a></li>
                    {% endfor %}
                </ul>
            </div>
            {% endif %}
        {% else if item.html|uw == "reply" %}
            {% if base.new_reply|not_empty %}
            <div class="widget">
                <h3>{{item.title|uw}}</h3>
                <ul class="comment">
                    {% for t in base.new_reply %}
                    <li>
                        <a href="/topic/get?id={{t.cid|uw}}#Com-{{t.id|uw}}"><strong>{{t.pname|uw}}</strong> : {{t.pcontent|uw}}</a>
                        {% if t.rcontent|is %}
                        <i class="iconfont" style="color:#F60;font-size:11px">&#xe654;</i>
                        {% endif %}
                    </li>
                    {% endfor %}
                </ul>
            </div>
            {% endif %}
        {% else if item.html|uw == "class" %}
            <div class="widget">
                <h3>{{item.title|uw}}</h3>
                <ul class="class">
                    {{base.class|uw|safe}}
                </ul>
            </div>
        {% else %}
            <div class="widget">
                <h3>{{item.title|uw}}</h3>
                <ul>{{item.html|uw|safe}}</ul>
            </div>
            {%endif%}
        {% endfor %}
    </div>
</div>